package com.axxy.observer;

/**
 * @author 一缕茜阳
 * @date 2021/7/15
 */
public class Test {
    public static void main(String[] args) {
        News newSubject = new News();
        Observer observer1 = new ReadNewsObserver();
        Observer observer2 = new WriteNewsObserver();
        newSubject.register(observer1);
        newSubject.register(observer2);
        newSubject.newsChange();
        newSubject.notifyObservers();
    }
}
